﻿<%@ Page Title="" Language="C#" MasterPageFile="~/user/MasterPage2.master" AutoEventWireup="true" CodeFile="ShoppingCart.aspx.cs" Inherits="user_ShoppingCart" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <style type="text/css">
        .auto-style5 {
            width: 100%;
            border:hidden;
        }
         .auto-style8{
            
            border:hidden;
        }
        .auto-style9 {
            text-align: center;
        }
        .auto-style10 {
            text-align: right;
            border-style: hidden;
            border-color: inherit;
            border-width: medium;
        }
        </style>
 
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
   
        <table class="auto-style8">
            <tr>
             <asp:Label ID="Label1" Text="商品名称：" runat="server" ></asp:Label>
            <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
                <td>
                    &nbsp; &nbsp; &nbsp; &nbsp;</td>
                <td>&nbsp;</td>
            <asp:Button ID="Button3" runat="server" Font-Size="14px" Text="搜索" OnClick="Button3_Click" />
            </tr>
            <tr >
                <td >
                    <div class="auto-style9">
                    <asp:GridView ID="GridView1" runat="server" AllowSorting="True" AutoGenerateColumns="False" 
                        CellPadding="4" CssClass="auto-style10" DataKeyNames="编号" DataSourceID="SqlDataSource1" text-align= "center"
                        OnRowDeleting="GridView1_RowDeleting" OnRowEditing ="GridView1_RowEditing"
                        OnRowUpdating="GridView1_RowUpdating" ViewStateMode="Disabled" GridLines="None" Width="945px">
                        <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                  
                        <Columns >
                         
                            <asp:TemplateField>
                                <ItemTemplate>
                                    <asp:CheckBox ID="CheckBox1" runat="server" AutoPostBack="True" OnCheckedChanged="CheckBox1_CheckedChanged"/>
                                </ItemTemplate>
                            </asp:TemplateField>
                             <asp:BoundField DataField="商品名称" HeaderText="商品名称" SortExpression="商品名称" ReadOnly="True"  />
                             <asp:ImageField DataImageUrlField="图片" HeaderText="商品图片" ReadOnly="True">
                		               <ControlStyle Height="120px" Width="120px" />
  	                                   <ItemStyle Width="150px" />
  	                         </asp:ImageField>
                             <asp:BoundField DataField="数量" HeaderText="数量" SortExpression="数量" />
                             <asp:BoundField DataField="价格" HeaderText="金额" SortExpression="金额" ReadOnly="True" />
                            <asp:CommandField ShowEditButton="True"  />                    
                            <asp:CommandField ShowDeleteButton="True" />

                        </Columns>

                      
            <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
            <RowStyle BackColor="#F7F6F3" ForeColor="#333333"  />
            <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
            <SortedAscendingCellStyle BackColor="#E9E7E2" />
            <SortedAscendingHeaderStyle BackColor="#506C8C" />
            <SortedDescendingCellStyle BackColor="#FFFDF8" />
            <SortedDescendingHeaderStyle BackColor="#6F8DAE" />
                    </asp:GridView>
                    </div>
                    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:keshe2ConnectionString %>" 
                        OldValuesParameterFormatString="original_{0}" 
                        SelectCommand="SELECT 选购.编号, 商品.商品名称, 商品.图片, 选购.数量, 商品.价格 FROM 选购 INNER JOIN 商品 ON 选购.商品编号 = 商品.商品编号 CROSS JOIN 客户 WHERE (客户.客户编号 = 选购.客户编号)"
                        UpdateCommand="  " 
                        DeleteCommand="DELETE FROM [选购 ]WHERE ([编号] = @original_编号)
">
                        <DeleteParameters>
                            <asp:Parameter Name="original_编号" />
                        </DeleteParameters>
                        
                    </asp:SqlDataSource>
                    <br />
                    

            

                     </td>
                <td>
            </tr>
            
             
       
           
        </table>
      <asp:CheckBox ID="CheckBox2" runat="server" AutoPostBack="True" Font-Size="14pt" margin-left="25px"  OnCheckedChanged="CheckBox2_CheckedChanged"
                        Text="全选" />
                     <asp:Button ID="Button1" runat="server" Font-Size="14pt" Text="取消" OnClick="Button1_Click" Width="60px" margin-left="25px"  />
                     &nbsp;&nbsp;&nbsp;&nbsp;
        <asp:Label ID="Label4" runat="server" ForeColor="#999999" Text="已选"></asp:Label>
        <asp:Label ID="Label5" runat="server" ForeColor="#999999"></asp:Label>
        <asp:Label ID="Label6" runat="server" ForeColor="Silver" Text="件，"></asp:Label>
        <asp:Label ID="Label2" runat="server" Text="合计:"></asp:Label>
        <asp:Label ID="Label7" runat="server" Font-Bold="True" Font-Size="Larger" ForeColor="Red" Text="$"></asp:Label>
        <asp:Label ID="Label3" runat="server"  ForeColor="Red" Font-Bold ="true" Font-Size ="X-Large"></asp:Label>
       <asp:Button ID="Button2" runat="server" Font-Size="14pt" Text="结算" OnClick="Button2_Click" Width="60px" margin-left="25px"/>
    <asp:Label ID="Label8" runat="server" Visible="False"></asp:Label>
   
       
   

        <asp:Button ID="Button4" runat="server" Text="刷新" Visible="False"  OnClick="Button4_Click" />
   
       
   

</asp:Content>

       